Destructor of a two_level self_organized_map
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(two_level_self_organizing_map) | :: | kohonen_map |
A |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | ix | ||||
integer, | public | :: | iy | ||||
integer, | public | :: | iz |
subroutine destroy_2lsom(kohonen_map) !======================================================================================== !! Destructor of a two_level self_organized_map class(two_level_self_organizing_map) :: kohonen_map !! A `two_level_self_organizing_map` object integer :: ix,iy,iz ! write(*,*) 'TWO LEVEL SOM: Releasing memory...' if(allocated(kohonen_map%grid)) then do ix=1,size(kohonen_map%grid,1) do iy=1,size(kohonen_map%grid,2) do iz=1,size(kohonen_map%grid,3); call kohonen_map%grid(ix,iy,iz)%destroy(); enddo enddo enddo deallocate(kohonen_map%grid); endif ! if(allocated(kohonen_map%coordinates)) then deallocate(kohonen_map%coordinates); endif ! if(allocated(kohonen_map%number_patterns)) then deallocate(kohonen_map%number_patterns); endif ! if(allocated(kohonen_map%cells_index)) then deallocate(kohonen_map%cells_index); endif ! if(allocated(kohonen_map%u_matrix)) then deallocate(kohonen_map%u_matrix); endif ! if(allocated(kohonen_map%distance)) then deallocate(kohonen_map%distance); endif ! if(allocated(kohonen_map%distance_function)) then deallocate(kohonen_map%distance_function); endif ! ! Deallocate cluster layers arrays ! do ix=1,size(kohonen_map%cluster_layer) call kohonen_map%cluster_layer(ix)%destroy(); enddo deallocate(kohonen_map%cluster_layer) ! if(allocated(kohonen_map%cluster_cells_index)) then deallocate(kohonen_map%cluster_cells_index); endif ! if(allocated(kohonen_map%cluster_number_patterns)) then deallocate(kohonen_map%cluster_number_patterns); endif ! if(allocated(kohonen_map%grid_cluster)) then deallocate(kohonen_map%grid_cluster); endif ! if(allocated(kohonen_map%cluster_samples)) then deallocate(kohonen_map%cluster_samples); endif ! if(allocated(kohonen_map%number_cluster_samples)) then deallocate(kohonen_map%number_cluster_samples); endif ! if(allocated(kohonen_map%index_cluster_samples)) then deallocate(kohonen_map%index_cluster_samples); endif ! write(*,*) 'TWO LEVEL SOM: Releasing memory...OK!' ! end subroutine destroy_2lsom